<?php if (isset($commentList)) {
    foreach ($commentList as $comment) {
        //如果点过赞 则使用实心的赞图标 如果没有则使用镂空的
        $isCommentUp = $myComment->comment_up_check($comment->Id, $InputData['comment_parent_type']);
        if ($isCommentUp === true) $recommendIconEx = ''; else $recommendIconEx = 'o-';
        //20170117 新增 获取每个评论的回复列表
        $replyCount = 0;
        $replyList = $myComment->comment_reply_list(
            $comment->Id, $InputData['comment_parent_type'], 0, $replyCount, 2, 1); //默认倒序
        ?>
        <li>
            <div class="app-avatar-bar am-text-xs">
                <div class="am-vertical-align" style="padding-top:4px">
                    <img class="am-circle app-avatar-sm" style="float: none" alt="" src="<?= $comment->Avatar ?>"/>
                    <div class="app-main-color am-vertical-align-middle" style="font-size: 12px;padding-left: 10px;">
                        <span id="comment_<?= $comment->Id ?>_user_name"><?= $comment->UserName; ?></span>
                        <?php if ($InputData['author_id'] == $comment->UserId) { ?>
                            <span class="app-comment-badge app-main-backcolor">作者</span>
                        <?php } ?>
                        <div onclick="comment_up(<?= $comment->Id ?>,this)"
                             style="position: absolute; right: 10px; top: 12px"
                             class="<?php
                             if ($comment->UpCount > 0) echo 'app-comment-up-count-en';
                             else echo 'app-comment-up-count-dis';
                             ?>">
                            <span><?= $comment->UpCount ?></span>
                            <i class="am-icon am-icon-fw am-icon-thumbs-<?= $recommendIconEx ?>up"></i>
                        </div>
                    </div>
                </div>
                <div class="app-avatar-bar-name" style="padding-left:40px; width: 100%">
                    <div onclick="goto_comment_edit('<?= $comment->Id ?>');" class="app-comment-text">
                        <?= $comment->Text; ?>
                    </div>
                    <div class="app-datetime-color"><?= $comment->CommentDt2; ?></div>
                    <?php if ($replyCount > 0) { ?>
                        <div onclick="comment_show('<?= $comment->Id ?>')"
                             style="border-top: 1px solid #dedede; margin-top: 15px; width: 100%">
                            <?php foreach ($replyList as $reply) { ?>
                                <div style="padding: 8px 0">
                                    <b><?= $reply->UserName ?>:</b>
                                    <span>
                    <?php
                    if ($reply->AtUserName != '') echo "回复@{$reply->AtUserName}: ";
                    echo $reply->Text;
                    ?>
                    </span>
                                </div>
                            <?php } ?>
                        </div>
                    <?php } ?>
                </div>
                <?php if ($replyCount > 2) { ?>
                    <div class="app-main-color" style="width: 100%; text-align: center">
                        <b>查看全部<?= $replyCount ?>条回复</b>
                    </div>
                <?php } ?>
            </div>
        </li>
    <?php }
} //foreach ($commentList as $comment)的结束  ?>